package com.example.tabbar.fragment

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Switch
import com.example.tabbar.databinding.FragmentCalibragmentBinding


class CalibrationFragment : Fragment() {
    private var binding: FragmentCalibragmentBinding? = null
    private var switchEnable: Switch? = null
    private var isShow: Switch? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        arguments?.let {
        }
    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        binding = FragmentCalibragmentBinding.inflate(inflater, container, false)
        return binding!!.root
    }
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        switchEnable = binding!!.switchEnable
        isShow = binding!!.switchShow

        binding!!.isEnable.setOnClickListener { _ ->
            switchEnable!!.isChecked = !switchEnable!!.isChecked
        }
        binding!!.isShow.setOnClickListener {  _ ->
            isShow!!.isChecked = !isShow!!.isChecked
        }

    }

    companion object {

        @JvmStatic
        fun newInstance() =
            CalibrationFragment().apply {
                arguments = Bundle().apply {

                }
            }
    }
}